package com.xiaouyudeguang.common.token;

import lombok.Getter;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.UserDetails;

import java.util.Collection;

public class AuthenticationToken extends com.zlyx.easy.security.authentication.token.AuthenticationToken {

    @Getter
    protected String tenantId;

    @Getter
    protected String clientSecret;

    public AuthenticationToken(Object principal, String grantType, String tenantId, String clientId) {
        this(principal, grantType, tenantId, clientId, null);
    }

    public AuthenticationToken(Object principal, String grantType, String tenantId, String clientId, String clientSecret) {
        super(principal, grantType, clientId);
        this.tenantId = tenantId;
        this.clientSecret = clientSecret;
    }

    public AuthenticationToken(Object principal, Collection<? extends GrantedAuthority> authorities) {
        super(principal, null, authorities);
    }

    public AuthenticationToken(Object principal, String clientId, Collection<? extends GrantedAuthority> authorities) {
        super(principal, clientId, authorities);
    }

    public AuthenticationToken(UserDetails userDetails, String clientId) {
        super(userDetails, clientId);
    }

}
